package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.model.product.BaseTrademark;
import com.atguigu.gmall.product.mapper.BaseTrademarkMapper;
import com.atguigu.gmall.product.service.BaseTrademarkService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author lfh
 * @version 1.0
 * @date 2021/4/12 18:13
 */
@Service
public class BaseTrademarkServiceImpl extends ServiceImpl<BaseTrademarkMapper,BaseTrademark> implements BaseTrademarkService {

    //服务层调用mapper
    @Autowired
    private BaseTrademarkMapper baseTrademarkMapper;

    //分页列表
    @Override
    public IPage getBaseTradeMarkList(Page<BaseTrademark> baseTrademarkPage) {
        //添加一个排序规则
        QueryWrapper<BaseTrademark> baseTrademarkQueryWrapper = new QueryWrapper<>();
        baseTrademarkQueryWrapper.orderByDesc("id");
        //调用查询方法
        return baseTrademarkMapper.selectPage(baseTrademarkPage, baseTrademarkQueryWrapper);
    }

    /*//新增BaseTrademark
    @Override
    public void save(BaseTrademark baseTrademark) {
        baseTrademarkMapper.insert(baseTrademark);
    }*/
}
